<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Crm;

return array(
    'router' => array(
        'routes' => array(
            'home' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/',
                    'defaults' => array(
                        'controller' => 'Crm\Controller\Login',
                        'action'     => 'index',
                    ),
                ),
            ),
            // The following is a route to simplify getting started creating
            // new controllers and actions without needing to create a new
            // module. Simply drop new controllers in, and you can access them
            // using the path /application/:controller/:action
            'crm' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/crm',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Crm\Controller',
                        'controller'    => 'Login',
                        'action'        => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'index' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/index[/:action]',
                            'defaults' => array(
                                'controller'    => 'Index',
                                'action'        => 'index',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    'test' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/test[/:action]',
                            'defaults' => array(
                                'controller'    => 'Test',
                                'action'        => 'index',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    'banner' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/banner[/:action]',
                            'defaults' => array(
                                'controller'    => 'Banner',
                                'action'        => 'index',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    'order' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/order[/:action][/:id]',
                            'defaults' => array(
                                'controller'    => 'Order',
                                'action'        => 'index',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'id'         => '[0-9]+',
                            ]
                        ),
                    ),
                    'crmuser' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/crmuser[/:action]',
                            'defaults' => array(
                                'controller'    => 'Crmuser',
                                'action'        => 'index',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    'org' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/org[/:action]',
                            'defaults' => array(
                                'controller'    => 'Org',
                                'action'        => 'index',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    
                    'product' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/product[/:action]',
                            'defaults' => array(
                                'controller'    => 'product',
                                'action'        => 'list',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    
                    'shop' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/shop[/:action]',
                            'defaults' => array(
                                'controller'    => 'shop',
                                'action'        => 'list',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    
                    'customer' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/customer[/:action]',
                            'defaults' => array(
                                'controller'    => 'customer',
                                'action'        => 'list',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    
                    'material' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/material[/:action]',
                            'defaults' => array(
                                'controller'    => 'material',
                                'action'        => 'list',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    
                    'login' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/login[/:action]',
                            'defaults' => array(
                                'controller'    => 'login',
                                'action'        => 'index',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    'recharge' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/recharge[/:action][/:id]',
                            'defaults' => array(
                                'controller'    => 'recharge',
                                'action'        => 'index',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'id'         => '[0-9]+',
                            ]
                        ),
                    ),
                    'voucher' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/voucher[/:action][/:id]',
                            'defaults' => array(
                                'controller'    => 'voucher',
                                'action'        => 'index',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'id'         => '[0-9]+',
                            ]
                        ),
                    ),
                    
                    
                    'financial' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/financial[/:action]',
                            'defaults' => array(
                                'controller'    => 'financial',
                                'action'        => 'list',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    
                    'supervision' => array(
                        'type' => 'segment',
                        'options' => array(
                            'route'    => '/supervision[/:action]',
                            'defaults' => array(
                                'controller'    => 'supervision',
                                'action'        => 'org',
                            ),
                            'constraints' => [
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ]
                        ),
                    ),
                    
                    
                    
                    
                ),
            ),
        ),
    ),
    'service_manager' => array(
        'abstract_factories' => array(
            'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
            'Zend\Log\LoggerAbstractServiceFactory',
        ),
        'factories' => array(
            'translator' => 'Zend\Mvc\Service\TranslatorServiceFactory',
        ),
    ),
    'di' => array(
        'services' => array(
    
        )
    ),
    'translator' => array(
        'locale' => 'en_US',
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),
    'controllers' => array(
        'invokables' => array(
            'Crm\Controller\Index' => Controller\IndexController::class,
            //'Crm\Controller\Test' => Controller\TestController::class,
            'Crm\Controller\Order' => Controller\OrderController::class,
            'Crm\Controller\Banner' => Controller\BannerController::class,
            'Crm\Controller\Org' => Controller\OrgController::class,
            'Crm\Controller\Product' => Controller\ProductController::class,
            'Crm\Controller\Material' => Controller\MaterialController::class,
            'Crm\Controller\Customer' => Controller\CustomerController::class,
            'Crm\Controller\Crmuser' => Controller\CrmuserController::class,
            'Crm\Controller\Login' => Controller\LoginController::class,
            'Crm\Controller\Financial' => Controller\FinancialController::class,
            'Crm\Controller\Recharge' => Controller\RechargeController::class,
            'Crm\Controller\Voucher' => Controller\VoucherController::class,
            'Crm\Controller\Shop' => Controller\ShopController::class,
            'Crm\Controller\Supervision' => Controller\SupervisionController::class,
            
            
        ),
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
        'exception_template'       => 'error/index',
        'template_map' => array(
            'layout/layout'           => __DIR__ . '/../view/layout/layout.phtml',
            'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
            'error/404'               => __DIR__ . '/../view/error/404.phtml',
            'error/index'             => __DIR__ . '/../view/error/index.phtml',
        ),
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
    //视图助手
    'view_helpers' => array(
        'invokables' => array(
            'CommonHelper' => 'Crm\View\Helper\CommonHelper',
            'flashMessengerHelper' => 'Crm\View\Helper\FlashMessenger',
        )
    ),
    // Placeholder for console routes
    'console' => array(
        'router' => array(
            'routes' => array(
            ),
        ),
    ),
);
